From 23f371535896d81a3d711d9cdf8d3d10ea309622 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 16 Aug 2006 14:26:59 +0100 Subject: [PATCH] [NET] front: Fix features on resume when csum is off When the netfront driver is resumed the features are renegotiated with the backend. However, I forgot take into account the status of the TX checksum setting. When TX checksum is disabled by the user, we cannot enable SG or TSO since both require checksum offload. This patch makes xennet check the checksum setting before renegotiating SG or TSO. This bug was fixed thanks to a report from Anton Burtsev. Signed-off-by: Herbert Xu --- linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index d1c324db2b..b2ca651773 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -1369,6 +1369,10 @@ static void xennet_set_features(struct net_device *dev) dev->features |= NETIF_F_GSO_ROBUST; xennet_set_sg(dev, 0); + /* We need checksum offload to enable scatter/gather and TSO. */ + if (!(dev->features & NETIF_F_ALL_CSUM)) + return; + if (!xennet_set_sg(dev, 1)) xennet_set_tso(dev, 1); } -- 2.30.2